
package model.test;

/**
 *
 * @author FELIPE & NICOLAS
 */
public class MFIBQ extends Question {
    
    
    
    
    //class Constructor
    public MFIBQ(String questionTxt,int marks,float penalty,String imageFile){
        
        super(questionTxt,marks,penalty,imageFile);//superclass constructor
        this.type="MFIBQ";//variable from superclass

        
    }
    
    
    ////constructor 2 (from a string readed from a txt file, which has been pased by the SUBSECTION constructor)
    public MFIBQ(String inputString){
        
        super("empty",0,0,""); //trick, then modify it
        
        
        String[] readResultQuestion = inputString.split("~"); //readResultQuestion is an array that represents each question, which contain the info about the question
        
        //data about the question
        this.type = readResultQuestion[0];              
        this.questionTxt = readResultQuestion[1];
        this.marks =Integer.parseInt(readResultQuestion[2]);
        this.penalty =Float.parseFloat(readResultQuestion[3]);
        this.imageFile = readResultQuestion[4];
        
    }
    
    
    
    //toString method
    public String toString(){
        return this.type + "~" +this.questionTxt+ "~" + this.marks +"~"+ this.penalty+"~"+ this.imageFile;
    }
    


    public int getMarks() {
        return marks;
    }

    public void setMarks(int marks) {
        this.marks = marks;
    }
    
    public float getPenalty() {
        return penalty;
    }

    public void setPenalty(int penalty) {
        this.penalty = penalty;
    }

    public String getQuestionTxt() {
        return questionTxt;
    }

    public void setQuestionTxt(String questionTxt) {
        this.questionTxt = questionTxt;
    }

    public String getType() {
        return type;
    }
    
    public void setImageFile(String imageFile) {
        this.imageFile = imageFile;
    }

    public String getImageFile() {
        return imageFile;
    }
    //you cannot change the type of question
    //public void setType(String type) {
      //  this.type = type;
    //}
    
    
    
    
    

    //FOR TESTING PURPOSE
    public static void main(String[] args) {
        
        MFIBQ temp = new MFIBQ("hello <blank> kj <blank>",10,3,"jajaja.jpg");
        MFIBQ temp2 = new MFIBQ("MFIBQ~hello <blank> kj <blank>~10~3.0~jajaja.jpg");
        
        System.out.println(temp);
        System.out.println(temp2.imageFile);


    }
}
